package org.rcgwt.client.ui.validator.impl;

import org.rcgwt.client.ui.validator.IClientValidatorContext;
import org.rcgwt.client.ui.validator.IFilter;
import org.rcgwt.client.ui.validator.ISingleton;
import org.rcgwt.client.ui.validator.IValidatorElement;

/**
 * A Filter which filters blank characters
 * 
 * @author Elian ORIOU
 * 
 */

public class NoBlankFilter implements IFilter, ISingleton {

	private static final NoBlankFilter INSTANCE = new NoBlankFilter();

	protected NoBlankFilter() {

	}

	@Override
	public boolean filter(IClientValidatorContext context, char ch) {
		if (ch == ' ') {
			return false;
		}

		return true;
	}

	public static IValidatorElement getInstance() {
		return INSTANCE;
	}

}
